package cn.rui.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.rui.common.ResponseBean;
import cn.rui.pojo.vo.PageVo;
import cn.rui.service.LoginLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;

@RestController
@RequestMapping("loginLog")
@Api(tags = "登录日志模块")
public class LoginLogController {

    @Autowired
    private LoginLogService loginLogService;



    @PostMapping("findPage")
    @SaCheckLogin
    @ApiOperation(value = "分页查询登录日志")
    public ResponseBean findPage(@RequestBody PageVo pageVo, HttpSession session){
        return loginLogService.findPage(pageVo,session);
    }

    @DeleteMapping("deleteById")
    @SaCheckLogin
    @ApiOperation(value = "删除登录日志")
    public ResponseBean deleteById(Integer id){
        return loginLogService.deleteById(id);
    }
}